package cn.edu.zzuli.web.bean.rowmapper;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;

import cn.edu.zzuli.web.bean.User;

public class UserRowMapper implements RowMapper<User>{

	public User mapRow(ResultSet rs, int num) throws SQLException {
		
		User ret = new User();
		ret.setId(rs.getInt("id"));
		ret.setUsername(rs.getString("username"));
		ret.setNickname(rs.getString("nickname"));
		ret.setPassword(rs.getString("password"));
		ret.setSex(rs.getString("sex"));
		ret.setBirthday(rs.getString("birthday"));
		ret.setMajor(rs.getString("major"));
		ret.setAddress(rs.getString("address"));
		ret.setIntroduces(rs.getString("introduces"));
		ret.setEnabled(rs.getInt("enabled"));
		
		return ret;
	}
}
